<template>
  <div class="index">
    <NavBar />
    <div class="dashboardAuth user dashboard-head">
      <div>
        <div class="head item">
          <div class="container">
            <div class="photo photo-level">
              <img :src="me.sysUser.avatar">
              <span :class="[`level`,`level_${me.sysUser.authType}`]"></span>
            </div>
            <div v-if="me.sysUser.authType==='0'||!me.sysUser.authType" class="name">
              <h1 class="ftz24">{{me.sysUser.userAccount}}</h1>
            </div>
            <div v-if="me.sysUser.authType === '1'||me.sysUser.authType === '2'||me.sysUser.authType === '3'" class="name">
              <div>
                <span class="ftz24">{{me.sysUser.authName}}</span>
                <i>我的主页</i>
              </div>
              <div>
                <span>关注 {{me.focusNum}}</span>
                <span>｜</span>
                <span>粉丝 {{me.fansNum}}</span>
              </div>
            </div>
            <div class="fr info">
              <ul>
                <li>
                  <span class="ftz16">{{me.viewpointNum}}篇</span>
                  <p>观点</p>
                </li>
                <li v-if="me.authType !=='3'">
                  <span class="ftz16">{{me.planNum}}篇</span>
                  <p>计划</p>
                </li>
                <li>
                  <span class="ftz16">{{me.answerNum}}次</span>
                  <p>回答</p>
                </li>
                <li>
                  <span class="ftz16">{{me.subscriptionNum}}次</span>
                  <p>订阅量</p>
                </li>
                <li>
                  <span class="ftz16">{{me.incomeAll}}中亿币</span>
                  <p>收益</p>
                </li>
              </ul>
            </div>
          </div>
        </div>

        <div class="container-user">
          <div class="con w82 item fr">
            <transition name="fade" mode="out-in">
              <keep-alive>
                <router-view />
              </keep-alive>
            </transition>
          </div>
          <div class="w15 item fl" style="margin: 0;">
            <Sider></Sider>
          </div>
        </div>
      </div>
    </div>
    <Footer />
  </div>
</template>
<script>
// import $ from 'jquery'
import NavBar from '@/components/nav-bar'
import Footer from '@/components/footer'
// import Laypage from '@/components/laypage'
import Sider from '@/components/side-bar2'
import { mapState } from 'vuex'
// import cookie from '@/utils/cookie'
export default {
  components: {
    NavBar,
    Footer,
    // Laypage,
    Sider
  },
  data () {
    return {
      showSubMenusFlag: false
    }
  },
  computed: {
    // 来源网址
    url () {
      return this.$route.query.url || ''
    },
    curRoute () {
      return this.$route.path
    },
    ...mapState({
      me: state => state.me
    })
  },
  created () {
    this.$store.dispatch('getUserInfo')
  },
  methods: {
    showSubMenus () {
      this.showSubMenusFlag = !this.showSubMenusFlag
    }
  }
}
</script>
<style lang="scss" scoped>
@import "../../style/res/user";
.container {
  min-height: auto;
}
</style>
